fix(express): require auth token for external signer mode - #9452
Conversation
Close the CWE-306 gap where signerMode routes accepted unauthenticated sign/TSS/OFC requests against disk-held user keys. Require BITGO_SIGNER_AUTH_TOKEN/--signerAuthToken at startup and validate Bearer on signer routes; forward the token from generator Express to externalSignerUrl.
Reviewer note (external whitehat)
Ask: Why this should not wait on “silent discovery”: the broken behavior is already demonstrated (missing |
|
Closing this PR at researcher request. We are revisiting disclosure packaging. The underlying finding (signerMode missing authentication) remains valid and will be handled via coordinated disclosure (Bugcrowd / BitGo security), not this public patch PR for now. |
Summary
--signerModepreviously mounted/api/v2/{coin}/sign, TSS share, and OFC external sign routes behindprepareBitGoonly, which never rejects a missingAuthorizationheader. Any network client that could reach the signer port could use disk-held user keys as an unauthenticated signing oracle.signerAuthToken(--signerAuthToken/BITGO_SIGNER_AUTH_TOKEN) wheneversignerModeorexternalSignerUrlis configured. Signer routes now reject missing/wrong Bearer with HTTP 401 (timing-safe compare). Generator Express forwards the same token when callingexternalSignerUrl.Breaking change / migration
Operators running external signing must set a shared secret on both the signer and generator Express instances, e.g.:
Test plan
/api/v2/tbtc/sign→ 401signerAuthTokenin signerMode throwsExternalSignerConfigError